package com.framework.buss.ai.controller;

import com.framework.buss.ai.params.SettingParam;
import com.framework.buss.ai.service.ISettingService;
import com.framework.buss.ai.vo.SettingVO;
import com.framework.common.domain.ResultData;
import com.framework.common.vo.TreeNode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangzhg
 */
@RestController
@RequestMapping("/setting")
@Api(value = "setting", tags = "页面问题设置")
public class SettingController {
    @Autowired
    private ISettingService settingService;

    @ApiOperation("获取列表接口")
    @GetMapping("list")
    public ResultData<List<TreeNode<SettingVO>>> list(SettingParam param) {
        List<TreeNode<SettingVO>> tree = settingService.tree(param);
        return ResultData.data(tree);
    }
}
